package com.yzz.hzraisedust.hzraseidust.modelbean;

import com.yzz.hzraisedust.hzraseidust.R;
import com.yzz.hzraisedust.hzraseidust.util.AirQualityUtil;

import java.io.Serializable;

/**
 * Created by zhengzhen on 2017/8/19.
 */

public class MapItemBean implements Serializable{

    private String ID;
    private String name;
    private String SN;
    private String updatetime;
    private float pm10;
    private float pm2_5;
    private float pm100;
    private float temperature;
    private float humidity;
    private int airquality;
    private int alarm;
    private double windyspeed;
    private float noise;
    private double lng;
    private double lat;
    private String CityName;
    private int state;

    private int  backgroudColor;

    public int getBackgroudColor() {
        return backgroudColor;
    }

    private int backGroudId;
    private String pmDescribe;

    private String ProAddress  ;

    public String getProjectAddress() {
        return ProAddress  ;
    }
    public void setProjectAddress(String projectAddress) {
        ProAddress   = projectAddress;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSN() {
        return SN;
    }

    public void setSN(String SN) {
        this.SN = SN;
    }

    public String getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(String updatetime) {
        this.updatetime = updatetime;
    }

    public float getPm10() {
        return pm10;
    }

    public void setPm10(float pm10) {
        this.pm10 = pm10;
    }

    public float getNoise() {
        return noise;
    }

    public void setNoise(float noise) {
        this.noise = noise;
    }

    public double getLng() {
        return lng;
    }

    public void setLng(double lng) {
        this.lng = lng;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public int getBackGroudId() {
        return backGroudId;
    }

    public String getPmDescribe() {
        return pmDescribe;
    }

    public String getCityName() {
        return CityName;
    }
    public void setCityName(String cityName) {
        CityName = cityName;
    }

    public float getPm2_5() {
        return pm2_5;
    }

    public float getPm100() {
        return pm100;
    }

    public float getTemperature() {
        return temperature;
    }

    public float getHumidity() {
        return humidity;
    }

    public int getAirquality() {
        return airquality;
    }

    public int getAlarm() {
        return alarm;
    }

    public double getWindyspeed() {
        return windyspeed;
    }

    //根据pm10更新描述及背景
    public  void concute(){
        if(pm10 > AirQualityUtil.WORSET_AIR){
            backgroudColor = 0x7d0122;
            backGroudId = R.mipmap.map_worst_warning;
            pmDescribe = "严重污染";
        }else if(pm10 > AirQualityUtil.SERIOURS_AIR){
            backgroudColor = 0x650199;
            backGroudId = R.mipmap.map_ser_warning;
            pmDescribe = "重度污染";
        }else if(pm10 >AirQualityUtil.WRNING_AIR){
            backgroudColor = 0xcb0133;
            backGroudId = R.mipmap.map_middle_warning;
            pmDescribe = "中度污染";
        }else if(pm10 > AirQualityUtil.BETTER_AIR){
            backgroudColor = 0xff9a32;
            backGroudId = R.mipmap.map_little_warning;
            pmDescribe = "轻度污染";
        }else if(pm10 > AirQualityUtil.BEST_AIR){
            backgroudColor = 0xfede31;
            backGroudId = R.mipmap.map_normal;
            pmDescribe = "良";
        }else if(pm10 >0){
            backgroudColor = 0x009965;
            backGroudId = R.mipmap.map_best;
            pmDescribe = "优";
        }
        if(state == 0) {
            backgroudColor = 0x000000;
            backGroudId = R.mipmap.map_offline;
            pmDescribe = "离线";
        }

    }

    public int isState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
}
